package test3

object Gaojiezhongzhi {
  def main(args: Array[String]): Unit = {
    var x: Int = 2
    val c = x.to(20)
    println(c)
    var f = (x: Int) => x + 1
    //List(1,2,3).map(f).foreach(println)
    List(1, 2, 3) map f foreach println
    println("?????????????????????????")
    v(x=>x*x*x,1,20)
  }

  def v(fun: (Int) => Int, low: Int, high: Int): Unit = {
    for (i: Int <- low to high) {
      println(fun(i))
    }
  }
}
